package com.itcast.chengma.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itcast.chengma.domain.Question;
import com.itcast.chengma.domain.vo.QuestionVo;
import com.itcast.chengma.mapper.QuestionMapper;
import com.itcast.chengma.service.QuestionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 问题业务层实现类
 *
 * @Author XiaoJiangShi
 * @Date 2022/8/25 9:33
 * @Blog blog.XiaoJiangShi.net/996.mba
 * @Description: 问题业务层实现类
 */
@Slf4j
@Service
public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> implements QuestionService {

    /**
     * 获取所有问题集合
     * @return 问题集合
     */
    @Override
    public List<QuestionVo> listByAll() {
        List<Question> list = this.list();
        List<QuestionVo> voList = new ArrayList<>();


        BeanUtils.copyProperties(list,voList);

        return voList;
    }
}

